<!DOCTYPE html>
<html lang="en">

<head>
    #include("./common/head.htm")
</head>

<body>
    #include("./common/header.htm")
    <div id="mainBody">
        <div class="container">
            <div class="row">
                <div class="span12" id="order-all">
                    <ul class="breadcrumb">
                        <li><a href="/view/catalog-main.html">首页</a> <span class="divider">/</span></li>
                        <li class="active">店铺</li>
                    </ul>
                    <h2>我的店铺</h2>
                    <div id="grids">
                        <ul class="nav nav-tabs" id="myTab">
                          <li class="active"><a href="#one" data-toggle="tab">店铺修改</a></li>
                          <li><a href="#two" data-toggle="tab">商品修改</a></li>
                          <li><a href="#three" data-toggle="tab">新增商品</a></li>
                        </ul>
                      <div class="tab-content">
                        <div class="tab-pane active" id="one">
                        <div class="row-fluid">
                          <div class="span12">
                            <h4>您的店铺信息如下</h4>
                            <section id="form">
                            <div class="row-fluid">
                            <div class="span6">
                                <form class="form-horizontal">
                                    <fieldset>
                                      <div class="control-group">
                                        <label class="control-label" for="input01">店铺名</label>
                                        <div class="controls">
                                          <input type="text" class="input-xlarge" id="input01" v-model="store.name">
                                          <span></span>
                                        </div>
                                      </div>
                                      <div class="control-group">
                                        <label class="control-label" for="input11">店铺地址</label>
                                        <div class="controls">
                                          <input type="text" class="input-xlarge" id="input11" v-model="store.address">
                                        
                                        </div>
                                      </div>
                                      <div class="control-group">
                                        <label class="control-label" for="input01">店铺所有者</label>
                                        <div class="controls">
                                          <input type="text" class="input-xlarge" id="input01" v-model="store.sellername">
                                          <span></span>
                                        </div>
                                      </div>

                                      <div class="control-group">
                                        <label class="control-label" for="input01">销售额</label>
                                        <div class="controls">
                                          <input type="text" class="input-xlarge" id="input01" v-model="store.salesvolume" readonly>
                                          <span></span>
                                        </div>
                                      </div>

                                      <div class="control-group">
                                        <label class="control-label" for="input01">好评率</label>
                                        <div class="controls">
                                          <input type="text" class="input-xlarge" id="input01" v-model="store.favorablerate" readonly>
                                          <span></span>
                                        </div>
                                      </div>

                                      <div class="form-actions">
                                        <button type="submit" class="btn btn-primary" @click.prevent="updateStore()" >修改</button>
                                        <button class="btn" @click.prevent="reset()" >恢复</button>
                                      </div>
                                    </fieldset>
                                  </form>
                                </div>
                                </div>
                            </section>
                            </div>
                        </div>
                        </div>
                        <div class="tab-pane" id="two">
                        <div class="row-fluid">
                            <div class="span12" >
                              <div v-for="(product,index) in productList">
                                <div class="row">	  
                                  <div class="span2">
                                    <img v-bind:src="product.src"  alt=""/>
                                  </div>
                                  <div class="span4">
                                    <h3>商品编号：{{ product.id }}</h3>
                                    <!-- <input type="number" v-model="product.price"></input>元		 -->
                                    <form>
                                      <fieldset>
                                        <div class="control-group">
                                          <label class="control-label" :for="'in0'+product.id">基准价格</label>
                                          <div class="controls">
                                            <input type="number" class="input-xlarge" :id="'in0'+product.id" v-model="product.price">
                                            <span></span>
                                          </div>
                                        </div>
                                        <div class="control-group">
                                          <label class="control-label" for="'in1'+product.id">商品库存</label>
                                          <div class="controls">
                                            <input type="number" class="input-xlarge" :id="'in1'+product.id" v-model="product.stock">
                                          </div>
                                          <div class="control-group">
                                            <label class="control-label" :for="'textarea'+product.id">商品描述</label>
                                            <div class="controls">
                                              <textarea class="input-xlarge" :id="'textarea'+product.id" rows="3" style="height:65px" v-model="product.description"></textarea>
                                            </div>
                                          </div>
                                    </fieldset>
                                    </form><p>
                                    </p>
                                    <br class="clr"/>
                                  </div>
                                  <div class="span3 alignR">
                                  <form class="form-horizontal qtyFrm">
                                  <a href="javascript:void(0)" class="btn btn-large btn-primary" @click.prevent="updateItem(product)">修改信息</i></a>     
                                  <br> <br>   
                                  <a href="javascript:void(0)" v-if="product.available==1" class="btn btn-large btn-danger" @click.prevent="deleteItem(product,index)">下架商品</i></a>     
                                  <a href="javascript:void(0)" v-else class="btn btn-large btn-success" @click.prevent="grounding(product,index)">上架商品</i></a>            
                                  </form>
                                  </div>
                                </div>
                                <hr class="soft"/>
                                </div>
                                <div class="pagination">
                                  <ul>
                                  <li><a href="javascript:void(0)" @click.prevent="backpage()">&lsaquo;</a></li>
                                  <li><a href="javascript:void(0)">{{ pageid }}</li>
                                  <li><a href="javascript:void(0)" @click.prevent="nextpage()">&rsaquo;</a></li>
                                  </ul>
                                  </div>
                                  <br class="clr"/>
                            </div>
                        </div>
                        </div>
                        <div class="tab-pane" id="three">
                          <div class="row-fluid">
                              <div class="span12">
                              <h4>您的店铺信息如下</h4>
                              <form class="form-horizontal">
                                <fieldset>
                                  <div class="control-group">
                                    <label class="control-label" for="select01">商品大类</label>
                                    <div class="controls">
                                      <select id="select01" v-model="selectedCategory" @change="load2ndCategory(selectedCategory)">
                                        <option v-for="(category,index) in categoryList" :value="category.id">{{ category.name }}</option>
                                      </select>
                                    </div>
                                  </div>
                                  <div class="control-group">
                                    <label class="control-label" for="select02">商品小类</label>
                                    <div class="controls">
                                      <select id="select02" v-model="selectedProduct">
                                        <option v-for="(secondCategory,index) in secondCategoryList" :value="secondCategory.productid" >{{ secondCategory.name }}</option>
                                      </select>
                                    </div>
                                  </div>
                                  <div class="control-group">
                                    <label class="control-label" for="text01">商品价格</label>
                                    <div class="controls">
                                      <input type="text" class="input-xlarge" id="text01" v-model="item.price ">
                                      <span></span>
                                    </div>
                                  </div>
                                  <div class="control-group">
                                    <label class="control-label" for="text11">商品库存</label>
                                    <div class="controls">
                                      <input type="text" class="input-xlarge" id="text11" v-model="item.stock">
                                    
                                    </div>
                                  </div>
                                  <div class="control-group">
                                    <label class="control-label" for="text10">商品描述</label>
                                    <div class="controls">
                                      <input type="text" class="input-xlarge" id="text10" v-model="item.description">
                                      <span></span>
                                    </div>
                                  </div>
                                  <div class="control-group">
                                    <label class="control-label" for="text00">图片编号</label>
                                    <div class="controls">
                                      <input type="text" class="input-xlarge" id="text00" v-model="item.pictureid">
                                      <span></span>
                                    </div>
                                  </div>
                                  <div class="form-actions">
                                    <button type="submit" class="btn btn-primary" @click.prevent="addItem()" >提交</button>
                                  </div>
                                </fieldset>
                              </form>
                              </div>
                          </div>
                        </div>
                      </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- MainBody End ============================= -->
    #include("./common/footer.htm")
</body>

</html>